<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by MAA Designs
http://www.maadesigns.co.uk
-->
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>A MOBILE BASED DIAGNOSIS EXPERT SYSTEM (m-TIBA)</title>
        <meta name="keywords" content="m-tiba,diagnosis,human expertise,artificial intelligence, mobile phone, interactive" />
        <meta name="description" content="M-tiba is an application that emulates human expertise in diagnosis
                    of diseases and technical issues .
                    The application relies on a back end knowledge
                    base populated by experts in the respective areas (See our test version below).
		    
                    Symptoms are provided by the user via a mobile phone in an interactive
                    way where the system sends queries to the user which he/she answers
                    with yes or no.  Based on the reply, the system applies A.I algorithms
                    to decide the most appropriate query to ask next in order to quickly
                    narrow down to a diagnosis.
		    Once a diagnosis is made, the system will
                    recommend a solution and preventive/control measures." />
        <link href="style/main.css" rel="stylesheet" type="text/css" />
        <link href="style/blitzer/jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css" />
        <link href="style/jquery.simplyscroll.css" rel="stylesheet" type="text/css" />
        <script src="/scripts/jquery-1.6.min.js" type="text/javascript"></script>
        <script src="/scripts/jquery-ui-1.8.13.custom.min.js" type="text/javascript"></script>
        <script src="/scripts/jquery.simplyscroll.min.js" type="text/javascript"></script>

        <script type="text/javascript">

            function validateComment(){
                input=document.commentForm.content.value;
                email=document.commentForm.email.value;
                //		alert("working");
                if(input.length==0 || email.length==0){
                    alert("Both email and comment text are required");
                    return false;
                }
                refreshComment();
            }


            function conne(){
                if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp=new XMLHttpRequest();
                }
                else{// code for IE6, IE5
                    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
                return xmlhttp;
            }

            function refreshComment(){
                //	alert("called");
                content=document.commentForm.content.value;
                email=document.commentForm.email.value;
                document.getElementById('mycomment').innerHTML="<h3>Loading....</h3>";
                var conn=conne();
                var nameurl="refresh_com?content="+content+"&email="+email;
                conn.open("GET",nameurl,false);
                conn.send(null);
                var answer=conn.responseText;
                // alert("the answer="+answer);
                document.getElementById('mycomment').innerHTML=answer;
                document.commentForm.content.value="";
                email=document.commentForm.email.value="";
            }
        </script>
        <script type="text/javascript">
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-10314424-8']);
            _gaq.push(['_trackPageview']);

            (function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();


        </script>
        <script>
            $(function() {
                $( "#accordion" ).accordion();
            });
            $(function() {
                $( "#accordion2" ).accordion();
            });
        </script>

        <script type="text/javascript">

            (function($) {

                $(function() {

                    $("#scroller").simplyScroll();

                });

            })(jQuery);

        </script>

    </head>
    <body>
        <div id="logo">
            <h2><a href="">M-Tiba, A Mobile Based Diagnosis System</a></h2>


        </div>
        <div id="menu">
            <h2>Navigation Menu</h2>
            <ul>
                <!--li class="active"><a href="/">Homepage</a></li-->
                <li><a href="http://perationtech.com" target="_blank">About us</a></li>
                <li><a href="/images/CropDiagnosis.apk">Android app</a></li>
                <li><a href="{{ logins.url }}">{{ logins.url_text }}</a></li>
                <!--                <li><a href="products.html">Products</a></li>
                                <li><a href="services.html">Services</a></li>
                                <li><a href="contact.html">Contact</a></li>-->
            </ul>
        </div>
        <div id="image">
            <ul id="scroller">

                <li><img src="/images/scroll/image1.png" width="207px" height="312px"/></li>
                <li><img src="/images/scroll/image2.png"  width="207px" height="312px"/></li>
                <li><img src="/images/scroll/image3.png"  width="207px" height="312px"/></li>
                <li><img src="/images/scroll/image4.png" width="207px" height="312px"/></li>
                <li><img src="/images/scroll/image5.png" width="207px" height="312px"/></li>
                <li><img src="/images/scroll/image6.png" width="207px" height="312px"/></li>
                <li><img src="/images/scroll/image7.png" width="207px" height="312px"/></li>
            </ul>
            <!--            <img src="images/services_image.jpg" alt="" width="780"  />-->
        </div>
        <div id="body">
            <h2 class="title">
                <!--                Press Ad Designs!-->
            </h2>
            <div class="story">
                <!--                <img src="images/images.jpg"  alt="maize plants" />-->
                <!--                <br/><br/>-->
                <h2>
                    {%if logins.loggedIn %}
                    Welcome {{logins.username}},
                    {% endif %}
                </h2>
                <!--                <br/><br/>-->
                {%if logins.username%}
                <fieldset>
                    <legend>Add Expert Knowledge</legend>
                    <form method='POST' action='/save_dis'>
                        <table class="noborder">
                            <tr><td>Diagnosis Type</td><td>
                                    <select name='diagType'>
                                        <option value='plants'>Plants</option>
                                        <option value='animals'>Animals</option>
                                        <option value='human'>Human</option>
                                        <option value='equipments'>Equipments</option>
                                    </select>
                                </td></tr>
                            <tr><td>Disease Name</td><td><input type='text' name='disease_name'/></td></tr>
                            <tr><td>Signs (Comma separated)</td><td><textarea name='symptoms'></textarea></td></tr>
                            <tr><td>Prevention</td><td><textarea name='prevention'></textarea></td></tr>
                            <tr><td>Weight</td><td><input type='text' name='weight' size='1'/></td></tr>
                            <tr><td style="text-align:right;" colspan=2><input type='submit'/></td></tr>
                        </table>
                    </form>
                </fieldset>
                {% endif %}
                <p>M-tiba is an application that emulates human expertise in diagnosis
                    of diseases and technical issues .
                    The application relies on a back end knowledge
                    base populated by experts in the respective areas (See our test version below).</p>
                <p>
                    Symptoms are provided by the user via a mobile phone in an interactive
                    way where the system sends queries to the user which he/she answers
                    with yes or no.  Based on the reply, the system applies A.I algorithms
                    to decide the most appropriate query to ask next in order to quickly
                    narrow down to a diagnosis. </p>
                <p>Once a diagnosis is made, the system will
                    recommend a solution and preventive/control measures.</p>
                <fieldset>
                    <legend>KNOWLEDGE BASE</legend>
                    <div id="accordion">
                        <h3><a href="#">Plants</a></h3>
                        <div>
                            <table width='70%' class="table_open">
                                <tr class="heading_row_start"><th>Disease</th><th>Symptoms</th><th>Management</th><th>W</th></tr>
                                {% for part in knowledge.plants %}
                                <tr class='{{forloop.counter|divisibleby:2|yesno:"row_start,row_alt_start"}}'>
                                    <td>{{part.disease_name}}</td><td>
                                        <p>
			     {% for symppart in part.symptomParts %}
				{{forloop.counter}}: {{symppart.symptom}}
			     {% endfor %}
                                        </p>
                                    </td><td>{{part.prevention}}</td><td>{{part.weight}}</td></tr>
                                {% endfor %}
                            </table>
                        </div>
                        <h3><a href="#">Animals</a></h3>
                        <div>
                            <table width='70%' class="table_open">
                                <tr class="heading_row_start"><th>Disease</th><th>Symptoms</th><th>Prevention/Management</th><th>W</th></tr>
                                {% for part in knowledge.animals %}
                                <tr class='{{forloop.counter|divisibleby:2|yesno:"row_start,row_alt_start"}}'>
                                    <td>{{part.disease_name}}</td><td>
                                        <p>
			     {% for symppart in part.symptomParts %}
				{{forloop.counter}}: {{symppart.symptom}}
			     {% endfor %}
                                        </p>
                                    </td><td>{{part.prevention}}</td><td>{{part.weight}}</td></tr>
                                {% endfor %}
                            </table>
                        </div>
                        <h3><a href="#">Windows Computers</a></h3>
                        <div>
                            <table width='70%' class="table_open">
                                <tr class="heading_row_start"><th>Disease</th><th>Symptoms</th><th>Prevention/Management</th><th>W</th></tr>
                                {% for part in knowledge.windows %}
                                <tr class='{{forloop.counter|divisibleby:2|yesno:"row_start,row_alt_start"}}'>
                                    <td>{{part.disease_name}}</td><td>
                                        <p>
			     {% for symppart in part.symptomParts %}
				{{forloop.counter}}: {{symppart.symptom}}
			     {% endfor %}
                                        </p>
                                    </td><td>{{part.prevention}}</td><td>{{part.weight}}</td></tr>
                                {% endfor %}
                            </table>
                        </div>
                        <h3><a href="#">Humans</a></h3>
                        <div>
                            <table width='70%' class="table_open">
                                <tr class="heading_row_start"><th>Disease</th><th>Symptoms</th><th>Prevention/Management</th><th>W</th></tr>
                                {% for part in knowledge.human %}
                                <tr class='{{forloop.counter|divisibleby:2|yesno:"row_start,row_alt_start"}}'>
                                    <td>{{part.disease_name}}</td><td>
                                        <p>
			     {% for symppart in part.symptomParts %}
				{{forloop.counter}}: {{symppart.symptom}}
			     {% endfor %}
                                        </p>
                                    </td><td>{{part.prevention}}</td><td>{{part.weight}}</td></tr>
                                {% endfor %}
                            </table>
                        </div>
                    </div>
                </fieldset>
                <br/><br/><br/>
                <fieldset>
                    <legend>RECENT SESSIONS</legend>
                    <p>This is a list of sessions created by mobile client applications.
                        It shows the signs that the user answered yes or no to and
                        the diagnosis that was consequently made.</p>

                    <table class="table_open">
                        <tr class="heading_row_start"><th>ID</th><th>Observed Signs</th><th>Signs not Observed</th><th>Diagnosis</th><th>Diagnosis Type</th><th>Time Created</th></tr>
                        {% for part in sessionParts %}
                        <tr  style="vertical-align:top;" class='{{forloop.counter|divisibleby:2|yesno:"row_start,row_alt_start"}}'><td>{{part.id}}</td><td>{{part.accepted}}</td><td>{{part.rejected}}</td><td>{{part.diagnosis}}</td><td>{{part.diagType}}</td><td>{{part.date1}}</td></tr>
                        {% endfor %}
                    </table>
                </fieldset>
                <br/><br/><br/>
                <fieldset>
                    <h3>Leave a comment</h3>
                    <br/>
                    <form action="/comm" method="post" name="commentForm">
                        <div>Email (Not Displayed):
                            <br/><input type="text" name="email" /></div>
                        <div>Comment:
                            <br/><textarea name="content" rows="3" cols="26"></textarea></div>
                        <div><input type="submit" value="Submit" onclick="validateComment(); return false"/></div>
                    </form>
                    <div id='mycomment'>
						{% for comment in comments %}
						  {{comment.date1}}: <b>{{comment.author}}</b><blockquote>{{comment.content}}</blockquote><hr/>
						{% endfor %}
                    </div>

                    <div class="fineline-flat"></div>

                    <div class="clear-flat"></div>
                </fieldset>
            </div>
        </div>
        <div id="bot">
            <p>Copyright &copy; 2012
                <a href="http://perationtech.com">Designed</a> by <a href="http://perationtech.com"><strong><img src="/images/PERATIONTECHLOGO.png" /></strong></a><br/><img src="/images/appengine.gif"/>
            </p>
        </div>

    </body>
</html>
